home *** CD-ROM | disk | FTP | other *** search
/ 64'er Special 7 / 64er_Magazin_Sonderheft_07_86-07_1986_Markt__Technik_de_Side_A.d64 / uhr vollst. (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  869b  |  33 lines

  1. 100 rem echtzeituhr stellen
  2. 110 cia=56328:rem anfangsadresse von cia 1
  3. 120 print"geben sie die genaue uhrzeit ein"
  4. 130 print"   hhmmss[157][157][157][157][157][157][157][157]";:inputz$
  5. 140 hh=val(left$(z$,2))
  6. 150 mm=val(mid$(z$,3,2))
  7. 160 ss=val(right$(z$,2))
  8. 170 ifhh>23ormm>59orss>59thenprint"eingabefehler":goto120
  9. 175 if hh>12thenhh=hh-12:tm=1
  10. 180 poke cia+7, peek(cia+7) and 255-2^7
  11. 190 poke cia+6, peek(cia+6) or 2^7
  12. 200 q= int(hh/10)*16+hh-int(hh/10)*10
  13. 205 if tm=1 then q=q+128
  14. 210 poke cia+3,q
  15. 220 q= int(mm/10)*16+mm-int(mm/10)*10
  16. 230 poke cia+2,q
  17. 240 q= int(ss/10)*16+ss-int(ss/10)*10
  18. 250 poke cia+1,q
  19. 260 poke cia+0,0: rem uhr starten
  20. 300 rem echtzeituhr lesen
  21. 310 cia=56328:rem anfangsadresse von cia 1
  22. 320 hh=peek(cia+3):zs=peek(cia)
  23. 330 mm=peek(cia+2)
  24. 340 ss=peek(cia+1)
  25. 350 tm=0: if hh>128 then tm=1:hh=hh-128:rem nachmittags
  26. 360 hh=int(hh/16)*10+(hh and 15)
  27. 370 if tm=1 and hh<>12 then hh=hh+12
  28. 375 if tm=0 and hh=12 then hh=0
  29. 380 mm=int(mm/16)*10+(mm and 15)
  30. 390 ss=int(ss/16)*10+(ss and 15)
  31. 400 print"[147]"hh":"mm":"ss
  32. 410 goto320
  33.